<!DOCTYPE html>
<html>
<head>
    <title>至上会计欢迎您</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="author" content="">
    <meta name="description" content="至上会计移动端CRM管理系统">
    <link rel="stylesheet" href="../lib/weui.min.css">
    <link rel="stylesheet" href="../css/jquery-weui.css">
    <link rel="stylesheet" href="css/mywe.css">
    <link rel="stylesheet" href="css/shop.css?v=1">
</head>
<body ontouchstart>
    <header class='demos-header'>
        <div class="demos-left" onclick="history.go(-1)"><i class="iconfont">&#xe65a;</i></div>
        <h3 class="demos-title">我的订单</h3>
    </header>
    <main>
        <div class="weui-tab">
            <div class="weui-navbar">
                <a class="weui-navbar__item weui-bar__item--on" href="#tab1">
                    代付款
                </a>
                <a class="weui-navbar__item" href="#tab2">
                    待服务
                </a>
                <a class="weui-navbar__item" href="#tab3">
                    服务中
                </a>
                <a class="weui-navbar__item" href="#tab4">
                    已完结
                </a>
            </div>
            <div class="weui-tab__bd">
                <div id="tab1" class="weui-tab__bd-item weui-tab__bd-item--active">
                    <div class="weui-panel weui-panel_access">
                        <div class="weui-panel__bd">
                            <a class="weui-media-box weui-media-box_appmsg" href="shopcart.html">
                                <div class="weui-media-box__hd">
                                    <img class="weui-media-box__thumb" src="./images/nophoto.png" alt="">
                                </div>
                                <div class="weui-media-box__bd">
                                    <h4 class="weui-media-box__title weui-flex">
                                        <div class="weui-flex__item">小规模代理记账
                                            (一年)<span class="color-gray">&nbsp;×3</span></div>
                                        <div class="color-red big">¥<span>300</span></div>
                                    </h4>
                                    <p class="weui-media-box__desc">服务地区：浙江省 杭州市 西湖区</p>
                                    <p class="weui-media-box__desc">服务者：肖芳芳</p>
                                </div>
                            </a>
                        </div>
                        <div class="weui-panel__ft">
                            <div class="weui-cell weui-cell_link">
                                <div class="weui-cell__bd">更多</div>
                                <div class="weui-cell__ft">
                                    <a href="javascript:;" class="order-opera color-gray">取消订单</a>
                                    <a href="javascript:;" class="order-opera color-red">去付款</a>
                                </div>
                            </div>
                        </div>
                        <div class="height8"></div>
                    </div>
                </div>
                <div id="tab2" class="weui-tab__bd-item">
                    <div class="weui-panel weui-panel_access">
                        <div class="weui-panel__bd">
                            <a class="weui-media-box weui-media-box_appmsg" href="shopcart.html">
                                <div class="weui-media-box__hd">
                                    <img class="weui-media-box__thumb" src="./images/nophoto.png" alt="">
                                </div>
                                <div class="weui-media-box__bd">
                                    <h4 class="weui-media-box__title weui-flex">
                                        <div class="weui-flex__item">小规模代理记账
                                            (一年)<span class="color-gray">&nbsp;×3</span></div>
                                        <div class="color-red big">¥<span>300</span></div>
                                    </h4>
                                    <p class="weui-media-box__desc">服务地区：浙江省 杭州市 西湖区</p>
                                    <p class="weui-media-box__desc">服务者：肖芳芳</p>
                                </div>
                            </a>
                        </div>
                        <div class="weui-panel__ft">
                            <div class="weui-cell weui-cell_link">
                                <div class="weui-cell__bd">更多</div>
                                <div class="weui-cell__ft">
                                    <a href="javascript:;" class="order-opera color-gray">催一催</a>
                                    <a href="javascript:;" class="order-opera color-red">催一催</a>
                                </div>
                            </div>
                        </div>
                        <div class="height8"></div>
                    </div>
                </div>
                <div id="tab3" class="weui-tab__bd-item">
                    <div class="weui-panel weui-panel_access">
                        <div class="weui-panel__bd">
                            <a class="weui-media-box weui-media-box_appmsg" href="shopcart.html">
                                <div class="weui-media-box__hd">
                                    <img class="weui-media-box__thumb" src="./images/nophoto.png" alt="">
                                </div>
                                <div class="weui-media-box__bd">
                                    <h4 class="weui-media-box__title weui-flex">
                                        <div class="weui-flex__item">小规模代理记账
                                            (一年)<span class="color-gray">&nbsp;×3</span></div>
                                        <div class="color-red big">¥<span>300</span></div>
                                    </h4>
                                    <p class="weui-media-box__desc">服务地区：浙江省 杭州市 西湖区</p>
                                    <p class="weui-media-box__desc">服务者：肖芳芳</p>
                                </div>
                            </a>
                        </div>
                        <div class="weui-panel__ft">
                            <div class="weui-cell weui-cell_link">
                                <div class="weui-cell__bd">更多</div>
                                <div class="weui-cell__ft">
                                    <a href="javascript:;" class="order-opera color-red">联系服务者</a>
                                </div>
                            </div>
                        </div>
                        <div class="height8"></div>
                    </div>
                </div>
                <div id="tab4" class="weui-tab__bd-item">
                    <div class="weui-panel weui-panel_access">
                        <div class="weui-panel__bd">
                            <a class="weui-media-box weui-media-box_appmsg" href="shopcart.html">
                                <div class="weui-media-box__hd">
                                    <img class="weui-media-box__thumb" src="./images/nophoto.png" alt="">
                                </div>
                                <div class="weui-media-box__bd">
                                    <h4 class="weui-media-box__title weui-flex">
                                        <div class="weui-flex__item">小规模代理记账
                                            (一年)<span class="color-gray">&nbsp;×3</span></div>
                                        <div class="color-red big">¥<span>300</span></div>
                                    </h4>
                                    <p class="weui-media-box__desc">服务地区：浙江省 杭州市 西湖区</p>
                                    <p class="weui-media-box__desc">服务者：肖芳芳</p>
                                </div>
                            </a>
                        </div>
                        <div class="weui-panel__ft">
                            <div class="weui-cell weui-cell_link">
                                <div class="weui-cell__bd">更多</div>
                                <div class="weui-cell__ft">
                                    <a href="javascript:;" class="order-opera color-red">评价</a>
                                    <a href="javascript:;" class="order-opera color-red">追评</a>
                                </div>
                            </div>
                        </div>
                        <div class="height8"></div>
                    </div>
                </div>
            </div>
        </div>
    </main>
    <footer class="weui-flex">
        <a href="/staffhome" class="weui-flex__item">
            <i class="iconfont">&#xe614;</i>
            <p>首页</p>
        </a>
        <a href="/workbench/contact" class="weui-flex__item">
            <i class="iconfont">&#xe809;</i>
            <p>通讯录</p>
        </a>
        <a href="/dailylook" class="weui-flex__item">
            <i class="iconfont">&#xe670;</i>
            <p>发现</p>
        </a>
        <a href="/custom" class="weui-flex__item active">
            <i class="iconfont">&#xe603;</i>
            <p>我的</p>
        </a>
    </footer>
    <script src="../lib/jquery-2.1.4.js"></script>
    <script src="../lib/fastclick.js"></script>
    <script src="../js/jquery-weui.min.js"></script>
    <script src="../js/city-picker.min.js"></script>

    <script>
        $(function () {
            FastClick.attach(document.body);
        });
        /*编辑*/
        $(".edit").click(function () {
            var a= $(".edit").html();
            if (a=="编辑"){
                $(".edit").html("完成");
                $(".countbox .count").hide();
                $(".countbox .hidden").show();
            }else if (a=="完成"){
                $(".edit").html("编辑");
                $(".countbox .hidden").hide();
                $(".countbox .count").show();
            }
        });
        /*删除商品*/
        $(".countbox .hidden").click(function () {
            var type=$(this).parents(".shoplist").find("input:checkbox")[0].checked;
            if(type==true){
                var num=Number($(this).parents(".shoplist").find(".countbox .num").text());
                var price=Number($(this).parents(".shoplist").find(".price").text());
                total-=price*num;
                $(".total").text(total);
            }
            $(this).parents(".shoplist").remove();
        });

        var total=Number($(".total").text());
        $("input:checkbox").each(function () {
            var type=$(this)[0].checked;
            var price=Number($(this).parents(".weui-check__label").find(".price").text());
            var num=Number($(this).parents(".weui-check__label").find(".num").text());
            if(type ==true){
                total+=price*num;
                $(".total").text(total);
            }
        });
        /*$("input:checkbox").each(function () {
            var type=$(this)[0].checked;
            var price=Number($(this).parents(".weui-check__label").find(".price").text());


            if(type ==true){
                total+=price;
                $(".total").text(total);
            }
        });*/
        /*加*/
        $(".add").click(function () {
            var num= $(this).parent().find(".num").text();
            num++;
            $(this).parents(".shoplist").find(".num").text(num);
            var type=$(this).parents(".shoplist").find("input:checkbox")[0].checked;
            if(type==true){
                var price=Number($(this).parents(".shoplist").find(".price").text());
                total+=price;
                $(".total").text(total);
            }
        });
        /*减*/
        $(".minus").click(function () {
            var num= $(this).parent().find(".num").text();
            if(num>1){
                num--;
                $(this).parents(".shoplist").find(".num").text(num);
                var type=$(this).parents(".shoplist").find("input:checkbox")[0].checked;
                if(type==true){
                    var price=Number($(this).parents(".shoplist").find(".price").text());
                    total-=price;
                    $(".total").text(total);
                }
            }else {
                $.toast("受不了了，<br>不能再少了！","text");
            }
        });
        /*选择商品*/
        $("input:checkbox").click(function () {
            var type=$(this)[0].checked;
            var price=Number($(this).parents(".weui-check__label").find(".price").text());
            var num=Number($(this).parents(".weui-check__label").find(".num").text());

            if(type ==true){
                total+=price*num;
                $(".total").text(total);
            }else {
                total-=price*num;
                $(".total").text(total);
            }
        });
    </script>

</body>
</html>